/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.financeiro.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "diagnostico_nivel1", catalog = "salao", schema = "public")
@NamedQueries({
    @NamedQuery(name = "DiagnosticoNivel1.findAll", query = "SELECT d FROM DiagnosticoNivel1 d")})
public class DiagnosticoNivel1 implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "diagnostico_nivel1_id_diagnostico_nivel1_seq")
    @SequenceGenerator(name = "diagnostico_nivel1_id_diagnostico_nivel1_seq", sequenceName = "diagnostico_nivel1_id_diagnostico_nivel1_seq", initialValue = 1, allocationSize = 1)
    @Basic(optional = false)
    @Column(name = "id_diagnostico_nivel1", nullable = false)
    private Integer idDiagnosticoNivel1;
    @Size(max = 40)
    @Column(name = "dsc_diagnostico_nivel1", length = 200)
    private String dscDiagnosticoNivel1;
    @Size(max = 1)
    @Column(name = "tip_contratado", length = 1)
    private String tipContratado;
    @Column(name = "dat_aprovacao", length = 10)
    private String datAprovacao;
    @Size(max = 1)
    @Column(name = "tip_terceiro", length = 1)
    private String tipTerceiro;
    @Column(name = "dat_terceiro_aprovacao", length = 10)
    private String datTerceiroAprovacao;
    @Size(max = 1)
    @Column(name = "tip_aplica", length = 1)
    private String tipAplica;
    
    @JoinColumn(name = "id_diagnostico", referencedColumnName = "id_diagnostico", nullable = false)
    @ManyToOne(optional = false, fetch = FetchType.EAGER)
    private Diagnostico idDiagnostico;
    
    public DiagnosticoNivel1() {
    }

    public DiagnosticoNivel1(Integer idDiagnosticoNivel1) {
        this.idDiagnosticoNivel1 = idDiagnosticoNivel1;
    }

    public Integer getIdDiagnosticoNivel1() {
        return idDiagnosticoNivel1;
    }

    public void setIdDiagnosticoNivel1(Integer idDiagnosticoNivel1) {
        this.idDiagnosticoNivel1 = idDiagnosticoNivel1;
    }

    public String getDscDiagnosticoNivel1() {
        return dscDiagnosticoNivel1;
    }

    public void setDscDiagnosticoNivel1(String dscDiagnosticoNivel1) {
        this.dscDiagnosticoNivel1 = dscDiagnosticoNivel1;
    }

    public Diagnostico getIdDiagnostico() {
        return idDiagnostico;
    }

    public void setIdDiagnostico(Diagnostico idDiagnostico) {
        this.idDiagnostico = idDiagnostico;
    }

    public String getTipContratado() {
        return tipContratado;
    }

    public void setTipContratado(String tipContratado) {
        this.tipContratado = tipContratado;
    }

    public String getDatAprovacao() {
        return datAprovacao;
    }

    public void setDatAprovacao(String datAprovacao) {
        this.datAprovacao = datAprovacao;
    }

    public String getTipTerceiro() {
        return tipTerceiro;
    }

    public void setTipTerceiro(String tipTerceiro) {
        this.tipTerceiro = tipTerceiro;
    }

    public String getDatTerceiroAprovacao() {
        return datTerceiroAprovacao;
    }

    public void setDatTerceiroAprovacao(String datTerceiroAprovacao) {
        this.datTerceiroAprovacao = datTerceiroAprovacao;
    }

    public String getTipAplica() {
        return tipAplica;
    }

    public void setTipAplica(String tipAplica) {
        this.tipAplica = tipAplica;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDiagnosticoNivel1 != null ? idDiagnosticoNivel1.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DiagnosticoNivel1)) {
            return false;
        }
        DiagnosticoNivel1 other = (DiagnosticoNivel1) object;
        if ((this.idDiagnosticoNivel1 == null && other.idDiagnosticoNivel1 != null) || (this.idDiagnosticoNivel1 != null && !this.idDiagnosticoNivel1.equals(other.idDiagnosticoNivel1))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.financeiro.entity.DiagnosticoNivel1[ idDiagnosticoNivel1=" + idDiagnosticoNivel1 + " ]";
    }
    
}
